#pragma once

#include <iostream>
#include <fstream>

#define BUFFER_SIZE 1024*1024 // 16 MB
#define FileAccessRead(input, fileName, bufferName) std::ifstream input(fileName.c_str()); \
  if (!input.good()) { std::cerr << "Error openning file " << fileName << std::endl; exit(1); } \
  char bufferName[BUFFER_SIZE]; \
  input.rdbuf()->pubsetbuf(bufferName,BUFFER_SIZE)

#define FileAccessWrite(output, fileName, bufferName) std::ofstream output(fileName.c_str())
